package com.lingyu.jsjx.service.impl;

import java.util.List;

import com.lingyu.jsjx.domain.Evaluation;
import com.lingyu.jsjx.mapper.EvaluationMapper;
import com.lingyu.jsjx.service.IEvaluationService;
import com.ruoyi.common.datascope.annotation.DataScope;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 教师评价Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-05
 */
@Service
public class EvaluationServiceImpl  extends ServiceImpl<EvaluationMapper, Evaluation> implements IEvaluationService
{
    @Autowired
    private EvaluationMapper evaluationMapper;

    /**
     * 查询教师评价
     * 
     * @param evaluationId 教师评价主键
     * @return 教师评价
     */
    @Override
    public Evaluation selectEvaluationByEvaluationId(Long evaluationId)
    {
        return evaluationMapper.selectEvaluationByEvaluationId(evaluationId);
    }

    /**
     * 查询教师评价列表
     * 
     * @param evaluation 教师评价
     * @return 教师评价
     */
    @Override
    @DataScope(deptAlias = "u", userAlias = "e",type = "jsjx")
    public List<Evaluation> selectEvaluationList(Evaluation evaluation)
    {
        return evaluationMapper.selectEvaluationList(evaluation);
    }

    /**
     * 新增教师评价
     * 
     * @param evaluation 教师评价
     * @return 结果
     */
    @Override
    public int insertEvaluation(Evaluation evaluation)
    {
        return baseMapper.insert(evaluation);
    }

    /**
     * 修改教师评价
     * 
     * @param evaluation 教师评价
     * @return 结果
     */
    @Override
    public int updateEvaluation(Evaluation evaluation)
    {

        return baseMapper.updateById(evaluation);
    }

    /**
     * 批量删除教师评价
     * 
     * @param evaluationIds 需要删除的教师评价主键
     * @return 结果
     */
    @Override
    public int deleteEvaluationByEvaluationIds(Long[] evaluationIds)
    {
        return evaluationMapper.deleteEvaluationByEvaluationIds(evaluationIds);
    }

    /**
     * 删除教师评价信息
     * 
     * @param evaluationId 教师评价主键
     * @return 结果
     */
    @Override
    public int deleteEvaluationByEvaluationId(Long evaluationId)
    {
        return baseMapper.deleteById(evaluationId);
    }
}
